

screens=aux_data(11,frame_times);
screens(9268:9314)=5;
nums=[1 0 2 0 1 0 2 0 1 0 2 0 1 0 2];

% % % pos=1;
% % % data_mat=[];
% % % cnt=1;
% % % 
% % % for j=1:length(screens)-1
% % %     if round(screens(j))~=round(screens(j+1))
% % %         data_mat(:,:,cnt)=calc_act_map(data(:,:,pos:j));
% % %         pos=j+1;
% % %         cnt=cnt+1;
% % %     end
% % %     if j==length(screens)-1
% % %         if cnt==15
% % %             data_mat(:,:,cnt)=calc_act_map(data(:,:,pos:end));
% % %         end
% % %     end
% % % end
% % % 
% % % std_act=std2(data_mat(:,:,1:15));
% % % median_act=median(median(median(data_mat(:,:,1:15))));
% % % max_a(ind)=median_act+(std_act*6);
% % % min_a(ind)=median_act-(std_act*0.5);
% % % 
% % % max_a=max(max(max(data_mat(:,:,1:15))))-2;
% % % min_a=min(min(min(data_mat(:,:,1:15))));
% % % 
% % % figure('color','black');
% % % axis off
% % % for h=1:size(data_mat,3)
% % %     subplot(4,4,h)
% % %     title(num2str(nums(h)),'color','white')
% % %     hold on
% % %     axis([0 size(data_mat,2) 0 size(data_mat,1)])
% % %     colorbar
% % %     set(gca,'clim',[min_a max_a])
% % %     imagesc(data_mat(:,:,h))
% % % end


turn=[];
cnt=1;
for j=1:length(screens)-1
    if j==1
        turn(cnt)=0;
        cnt=cnt+1;
    end
    if round(screens(j))~=round(screens(j+1))
        turn(cnt)=j;
        cnt=cnt+1;
    end
    if j==length(screens)-1
        turn(cnt)=length(screens);
    end
end

data_1(:,:,1:3513)=data(:,:,1:3513);
data_1(:,:,3514:4000)=data(:,:,10245:10731);

data_2(:,:,1:4000)=data(:,:,5423:9422);

data_off(:,:,1:1909)=data(:,:,3514:5422);
data_off(:,:,1910:2647)=data(:,:,9507:10244);
data_off(:,:,2648:3386)=data(:,:,14452:15190);
data_off(:,:,3387:4000)=data(:,:,19525:20138);


data_off2=calc_act_map(data_off);
data_1=calc_act_map(data_1);
data_2=calc_act_map(data_2);

figure('color','black')
imagesc(data_off2)
colorbar
title('baseline','color','white')
col=get(gca,'clim');

figure('color','black')
imagesc(data_1)
colorbar
title('env1','color','white')
set(gca,'clim',col)

figure('color','black')
imagesc(data_2)
colorbar
title('env2','color','white')
set(gca,'clim',col)



